home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: news.kei.com!wang!news
- From: emild@cs.technion.ac.il (Kohn Emil Dan)
- Subject: Re: HP UX 10.0 C programming
- Organization: Technion, Israel Institute of Technology
- Date: Fri, 5 Jan 1996 15:03:16 GMT
- Message-ID: <Pine.SV4.3.91-heb-2.04.960105165958.15614A-100000@cs.technion.ac.il>
- References: <4cfje3$qk@nn.fast.net>
- Sender: news@wang.com
-
- 5
-
- On 4 Jan 1996, Chad R. Laity wrote:
-
- > 2 questions: (1) What is a good book for HP UX 10.0 C programming?
- > (2) Why do I get an error on this cut down program listed
- > below when I compile it on an HP 9000 K200 with HP UX 10.0
- > and I do not get an error with our Intergraph server?
- > (basically I just want to get the file size of a file but
- > this buf problem is giving me a head ache)
- > ----------------------- program ---------------------------------
- >
- > #include <stdio.h>
- > #include <sys/stat.h>
- >
- > main()
- > {
- Perhaps this is your problem: You didn't define any variable of type
- 'struct stat'. stat.h contains only the declaration of struct stat, not a
- definition of any variable of this type.
-
- Add this line and see if it works:
-
- struct stat buf;
-
-
- > int i;
- > int stat(const char *path, struct stat *buf);
- >
- > i = stat("/usr2/test/testfile", &buf); /* line 15 */
- >
- > }
- >
- > ------------------------ error -----------------------------------
- > Compiled using: cc -Aa test.c
- >
- > cc: "test.c", line 15: error 1588: "buf" undefined.
- > cc: "test.c", line 15: warning 563: Argument #2 is not the correct type.
- >
- >
- >
-